//
//  ChainNormalRefreshHeader.m
//  Chain
//
//  Created by zhaosh on 2018/4/3.
//  Copyright © 2018年 zhaosh. All rights reserved.
//

#import "ChainNormalRefreshHeader.h"

@implementation ChainNormalRefreshHeader
#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
    [super prepare];
    
    // 设置普通状态的动画图片
    NSMutableArray *idleImages = [NSMutableArray array];
    for (NSUInteger i = 1; i<=85; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"图-%zd", i]];
        [idleImages addObject:image];
    }
    [self setImages:idleImages forState:MJRefreshStateIdle];
    
    // 设置即将刷新状态的动画图片（一松开就会刷新的状态）
    NSMutableArray *refreshingImages = [NSMutableArray array];
    for (NSUInteger i = 85; i<=120; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"图-%zd", i]];
        [refreshingImages addObject:image];
    }
    
    [self setImages:refreshingImages duration:2.0 forState:MJRefreshStatePulling];
    
    // 设置正在刷新状态的动画图片
    [self setImages:refreshingImages duration:2.0 forState:MJRefreshStateRefreshing];
    
    // 隐藏时间
    self.lastUpdatedTimeLabel.hidden = YES;
    
    // 隐藏状态
    self.stateLabel.hidden = YES;
    
}
@end
